package LiuLiangPre;

import com.csvreader.CsvReader;


import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class Solution {
    public static void main(String[] args) {

        float a=1;
        String b="12";
        System.out.println(Float.parseFloat(b));
        String filePath = "C:\\Users\\Lenovo\\Desktop\\中兴捧月\\train_step1.csv";

        try {
            // 创建CSV读对象
            CsvReader csvReader = new CsvReader(filePath);
            HashMap<String,Object> hashMap =new HashMap<>();
            while(csvReader.readRecord())
            {
                System.out.println(csvReader.get(1));
                //System.out.println(csvReader.getRawRecord());
               // System.out.println(csvReader.get(0)+"   "+csvReader.get(1));
                Student student = new Student();
                student.setId( csvReader.get(0));
                student.setDate(csvReader.get(1));
               // student.setValue(Float.parseFloat(csvReader.get(2)));
               hashMap.put(String.valueOf(student.getId()),student);
            }
//            Iterator iterator = hashMap.entrySet().iterator();
//            while(iterator.hasNext()){
//                Map.Entry entry = (Map.Entry) iterator.next();
//                Object key = entry.getKey();
//                Object value = entry.getValue();
//                System.out.println(key);
//                System.out.println(value);
//            }
            for (String key : hashMap.keySet()) {
                System.out.println("key= " + key + " and value= " + hashMap.get(key));
            }

            } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
